/**
 * @description  : 大案快报列表item
 * @descriptionDetail : 大案快报列表item
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-12-05 15:53:13
 */
<template>
  <view class="lt-root" @tap="itemClick">
    <view class="lt-row-space">
      <view class="lt-row">
        <view class="lt-left-label">
          案件编号：
        </view>
        <view class="lt-right-value case-style" @click.stop="intentCase">
          {{ itemInfo.caseCode }}
        </view>
      </view>
      <view style="flex-shrink: 0;">
        <u-tag :text="getStageName(itemInfo.stage)" :type="getStageColor(itemInfo.stage)" shape="circle" border-color="#ffffff00"></u-tag>
      </view>
    </view> 
    <view class="lt-row">
      <view class="lt-left-label">
        案件类型：
      </view>
      <view class="lt-right-value">
        {{ itemInfo.caseTypeName }}
      </view>
    </view>
    <view class="lt-row">
      <view class="lt-left-label">
        案值(万元)：
      </view>
      <view class="lt-right-value">
        {{ itemInfo.caseTotalVal }} 
      </view>
    </view>
    <view class="lt-row">
      <view class="lt-left-label">
        申报单位：
      </view>
      <view class="lt-right-value">
        {{ itemInfo.orgName }}
      </view>
    </view>
    <view class="lt-row">
      <view class="lt-left-label">
        申请时间：
      </view>
      <view class="lt-right-value">
        {{ itemInfo.applyTime }}
      </view>
    </view>
    <view class="lt-row">
      <view class="lt-left-label">
        案发地：
      </view>
      <view class="lt-right-value">
        {{ itemInfo.casePlace }}
      </view>
    </view>
  </view>
</template>

<script>
import caseService from "@/service/case/case.service.js";
export default{
  name:"ListItemMajorCaseReport",
  props:{
    itemInfo:{
      type: Object,
      default:() => { return {}; },
    },
  },
  data(){
    return {
		
    };
  },
  created() {
	
  },
  methods:{
    itemClick(){
      this.setRouteParam(this.itemInfo);
      // 跳转到 窝点的详情页面
      this.$u.route("pages/majorCaseReport/majorCaseReportInfo");
    },
    getStageColor(stage){
      if(stage == 'cg'){
        return "info";
      }else if(stage == 'shz'){
        return "warning";
      }else if(stage == 'dsb'){
        return "primary";
      }else if(stage == 'ysb'){
        return "success";
      }
      return "error";
    },
    getStageName(stage){
      if(stage == 'cg'){
        return "草稿";
      }else if(stage == 'shz'){
        return "审核中";
      }else if(stage == 'dsb'){
        return "待上报";
      }else if(stage == 'ysb'){
        return "已上报";
      }
      return "未知";
    },
    intentCase(){
      if(this.$u.test.isEmpty(this.itemInfo.caseUuid)){
        this.$u.toast("未关联案件，请先关联案件");
        return;
      }
      this.setRouteParam({
        caseCode: this.itemInfo.caseCode,
        caseUuid: this.itemInfo.caseUuid,
        from: "intelligence",  // 情报跳转和大案快报跳转一个逻辑
      });
      this.$u.route('/pages/case/offline/caseInfo');
    },
  },
}
</script>

<style scoped lang="scss">
@import "../list_item.scss";
.case-style{
	color: $u-type-primary;
}
</style>